package com.yzs.controller.admin;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yzs.common.bean.R;
import com.yzs.entity.TData;
import com.yzs.mapper.DataMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/data")
public class DataController {
    @Autowired
    DataMapper dataMapper;

    @RequestMapping("getData")
    public R getRoles(String key){
        QueryWrapper<TData> wrapper = new QueryWrapper<>();
        wrapper.eq("`key`",key);
        List<TData> d = dataMapper.selectList(wrapper);
        return R.ok(d);
    }

}
